package com.gxuwz.Market.business.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.gxuwz.Market.business.dao.ServiceDataDAO;
import com.gxuwz.Market.business.entity.ServiceData;
import com.gxuwz.Market.business.entity.ServiceField;
import com.gxuwz.Market.business.entity.ServiceForm;

@Service("serviceDataService")
public class ServiceDataImpl implements IServiceDataService {

	@Autowired
	private ServiceDataDAO serviceDataDAO;
	
	@Override
	public void createDB(String taskId, ServiceForm serviceForm) {
		serviceDataDAO.createDB(taskId, serviceForm);
	}

	@Override
	public void addWriter(String taskId, List<String> list) {
		serviceDataDAO.addWriter(taskId, list);
	}

	@Override
	public void add(String dataFormName, ServiceData serviceData) {
		// TODO Auto-generated method stub
		serviceDataDAO.add(dataFormName, serviceData);
	}

	@Override
	public void update(String dataFormName, ServiceData serviceData) {
		// TODO Auto-generated method stub
		serviceDataDAO.update(dataFormName, serviceData);
	}

	@Override
	public void delete(String dataFormName, int id) {
		// TODO Auto-generated method stub
		serviceDataDAO.delete(dataFormName, id);
	}

	@Override
	public List<ServiceData> findAll(String dataFormName, int fieldNum) {
		// TODO Auto-generated method stub
		return serviceDataDAO.findAll(dataFormName, fieldNum);
	}

	@Override
	public List<ServiceData> find(String dataFormName, int fieldNum, ServiceData serviceData) {
		return serviceDataDAO.find(dataFormName, fieldNum, serviceData);
	}

	@Override
	public boolean isWriter(String dataFormName, String writerId) {
		// TODO Auto-generated method stub
		return serviceDataDAO.isWriter(dataFormName, writerId);
	}

	@Override
	public ServiceData findByWriterId(String dataFormName, String writerId, int fieldNum) {
		// TODO Auto-generated method stub
		return serviceDataDAO.findByWriterId(dataFormName, writerId, fieldNum);
	}

	@Override
	public String finish(String dataName) {
		// TODO Auto-generated method stub
		return serviceDataDAO.finish(dataName);
	}

	@Override
	public void addDatas(String taskId, List<ServiceData> list, int fieldNum) {
		// TODO Auto-generated method stub
		serviceDataDAO.addDatas(taskId, list, fieldNum);
	}

	@Override
	public void editTaskForm(List<ServiceField> fieldOld, List<ServiceField> fieldNew, String dataName) {
		// TODO Auto-generated method stub
		serviceDataDAO.editTaskForm(fieldOld, fieldNew, dataName);
	}

	@Override
	public void copy(String newName, String oldName) {
		// TODO Auto-generated method stub
		serviceDataDAO.copy(newName, oldName);
	}

	@Override
	public String sendMail(String ids) {
		// TODO Auto-generated method stub
		return serviceDataDAO.sendMail(ids);
	}

	
}
